/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Winner
 */
@Entity
@Table(name = "tblManager")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblManager.findAll", query = "SELECT t FROM TblManager t"),
    @NamedQuery(name = "TblManager.findByMnID", query = "SELECT t FROM TblManager t WHERE t.mnID = :mnID"),
    @NamedQuery(name = "TblManager.findByMnName", query = "SELECT t FROM TblManager t WHERE t.mnName = :mnName"),
    @NamedQuery(name = "TblManager.findByMnUserName", query = "SELECT t FROM TblManager t WHERE t.mnUserName = :mnUserName"),
    @NamedQuery(name = "TblManager.findByMnPassword", query = "SELECT t FROM TblManager t WHERE t.mnPassword = :mnPassword"),
    @NamedQuery(name = "TblManager.findByMnEmail", query = "SELECT t FROM TblManager t WHERE t.mnEmail = :mnEmail"),
    @NamedQuery(name = "TblManager.findByMnAdress", query = "SELECT t FROM TblManager t WHERE t.mnAdress = :mnAdress"),
    @NamedQuery(name = "TblManager.findByMnPhone", query = "SELECT t FROM TblManager t WHERE t.mnPhone = :mnPhone"),
    @NamedQuery(name = "TblManager.findByMnStatus", query = "SELECT t FROM TblManager t WHERE t.mnStatus = :mnStatus"),
    @NamedQuery(name = "TblManager.findByMnPermission", query = "SELECT t FROM TblManager t WHERE t.mnPermission = :mnPermission"),
    @NamedQuery(name = "TblManager.checkLogin", query = "SELECT t FROM TblManager t WHERE t.mnUserName = :mnUserName AND t.mnPassword = :mnPassword"),

})
public class TblManager implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "mnID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer mnID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "mnName")
    private String mnName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "mnUserName")
    private String mnUserName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "mnPassword")
    private String mnPassword;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "mnEmail")
    private String mnEmail;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "mnAdress")
    private String mnAdress;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "mnPhone")
    private String mnPhone;
    @Column(name = "mnStatus")
    private Boolean mnStatus;
    @Column(name = "mnPermission")
    private Integer mnPermission;
    @OneToMany(mappedBy = "mnID")
    private List<TblComplaint> tblComplaintList;
    @OneToMany(mappedBy = "mnID")
    private List<TblOrder> tblOrderList;
    @OneToMany(mappedBy = "mnID")
    private List<TblFeedback> tblFeedbackList;
    @OneToMany(mappedBy = "mnID")
    private List<TblProject> tblProjectList;

    public TblManager() {
    }

    public TblManager(Integer mnID) {
        this.mnID = mnID;
    }

    public TblManager(Integer mnID, String mnName, String mnUserName, String mnPassword, String mnEmail, String mnAdress, String mnPhone) {
        this.mnID = mnID;
        this.mnName = mnName;
        this.mnUserName = mnUserName;
        this.mnPassword = mnPassword;
        this.mnEmail = mnEmail;
        this.mnAdress = mnAdress;
        this.mnPhone = mnPhone;
    }

    public Integer getMnID() {
        return mnID;
    }

    public void setMnID(Integer mnID) {
        this.mnID = mnID;
    }

    public String getMnName() {
        return mnName;
    }

    public void setMnName(String mnName) {
        this.mnName = mnName;
    }

    public String getMnUserName() {
        return mnUserName;
    }

    public void setMnUserName(String mnUserName) {
        this.mnUserName = mnUserName;
    }

    public String getMnPassword() {
        return mnPassword;
    }

    public void setMnPassword(String mnPassword) {
        this.mnPassword = mnPassword;
    }

    public String getMnEmail() {
        return mnEmail;
    }

    public void setMnEmail(String mnEmail) {
        this.mnEmail = mnEmail;
    }

    public String getMnAdress() {
        return mnAdress;
    }

    public void setMnAdress(String mnAdress) {
        this.mnAdress = mnAdress;
    }

    public String getMnPhone() {
        return mnPhone;
    }

    public void setMnPhone(String mnPhone) {
        this.mnPhone = mnPhone;
    }

    public Boolean getMnStatus() {
        return mnStatus;
    }

    public void setMnStatus(Boolean mnStatus) {
        this.mnStatus = mnStatus;
    }

    public Integer getMnPermission() {
        return mnPermission;
    }

    public void setMnPermission(Integer mnPermission) {
        this.mnPermission = mnPermission;
    }

    @XmlTransient
    public List<TblComplaint> getTblComplaintList() {
        return tblComplaintList;
    }

    public void setTblComplaintList(List<TblComplaint> tblComplaintList) {
        this.tblComplaintList = tblComplaintList;
    }

    @XmlTransient
    public List<TblOrder> getTblOrderList() {
        return tblOrderList;
    }

    public void setTblOrderList(List<TblOrder> tblOrderList) {
        this.tblOrderList = tblOrderList;
    }

    @XmlTransient
    public List<TblFeedback> getTblFeedbackList() {
        return tblFeedbackList;
    }

    public void setTblFeedbackList(List<TblFeedback> tblFeedbackList) {
        this.tblFeedbackList = tblFeedbackList;
    }

    @XmlTransient
    public List<TblProject> getTblProjectList() {
        return tblProjectList;
    }

    public void setTblProjectList(List<TblProject> tblProjectList) {
        this.tblProjectList = tblProjectList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mnID != null ? mnID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblManager)) {
            return false;
        }
        TblManager other = (TblManager) object;
        if ((this.mnID == null && other.mnID != null) || (this.mnID != null && !this.mnID.equals(other.mnID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
      //  return "com.aptech.entities.TblManager[ mnID=" + mnID + " ]";
        return this.getMnName();
    }
    
   
   
}
